DEVICE MMIQ

0.1 Introduction

The MMIQ device is need to create a human-machine interface system (HMI) programmable using the development environment Qpaint.
The device provides a range of information on the interface panel with a speed of update can be set by means of the sampling time.

0.2 Installazione

0.2.1 DEVICE DECLARATION IN THE CONFIGURATION UNIT (.CNF)

In the configuration unit, in the BUS section, must be declared an instrument whose firmware contains the MMIQ device.
In the INTDEVICE section must be add the following definition:

;---------------------------------
; Internal device declaration
;---------------------------------
INTDEVICE
<device name>   MMIQ         TCamp

where:

<device name>The name assigned to the device.
MMIQKeyword that identifies the device.
TcampTime sampling device (1÷10 ms).

0.2.1.1 Example

;--------------------------------
; Internal device declaration
;--------------------------------
INTDEVICE
DEV   MMIQ        0001

0.3 Operation

0.3.1 KEYSTROKES

The key and keyf parameters are used to recognise which key was pressed. The values associated with each key are given in the chapter of this manual “Commands and parameters”.
Any bit of the key and keyf parameters is associated with a button, so if you want to determine the pressing of several keys it helps to check that these parameters assume a value equal to the sum of the values associated with the keys.

0.3.2 LEDS

The leds and blinkleds parameters are used to access (or flashing) and turn off the leds on the keyboard.
Normally there is one led for each function key.
To access (or flashing) and turn off the led you must assign to the code associated with the function key.
Every bit of the leds and blinkleds parameters is associated with an led.

0.4 Commands and parameters table

0.4.1 Symbols used

The name of the parameter, state or command is shown at the left of the table.

R
Indicates if the parameter or state is retentive (upon initialization of the device maintains the previously defined state), or the state assumes upon initialization of the device.
If the device does not need to initialize the “R” field indicates the value that the parameter or state take to the power on of the card.
R = Retentive
0 = Upon initialization of the device the value is forced to zero.
1 = Upon initialization of the device the value is forced to one.
- = Upon initialization of the device is presented significant value.

D
Indicates the size of the parameter.
F = Flag
B = Byte
W = Word
L = Long
S = Single Float

0.4.1.1 Conditions

Are described all the conditions that must exist is considered correct or because the command is accepted.
In some cases, limit values are specified for the acceptance of the parameter: If there are any values outside the limits set, the data is in any case accepted; therefore appropriate controls of the application must be provided to ensure the proper functioning.
To run a command, all conditions must be met; otherwise the command is not sent.

A
Indicates the access mode.
R = Read.
W = Write.
R-W= Read / Write.

0.4.2 Commands / Parameters for the keyboard

NameDRAConditionsDescription
keyL-R-Key
Represents the state of the keys at all times. Each key is represented by one bit.
For the bit assignments refer to the following:
KEY_1 268435456
KEY_2 1048576
KEY_3 4096
KEY_4 536870912
KEY_5 2097152
KEY_6 8192
KEY_7 1073741824
KEY_8 4194304
KEY_9 16384
KEY_0 8388608
KEY_CLR -2147483648
KEY_ENTER 128
KEY_HELP 64
KEY_DECPT 32
KEY_SIGN 16
KEY_ESC 33554432
KEY_UP 131072
KEY_PGUP 512
KEY_LEFT 67108864
KEY_NEXT 262144
KEY_RIGHT 1024
KEY_INS 134217728
KEY_DOWN 524288
KEY_PGDN 2048
keyfL-R-Function Key
Represents the state of the function keys at all times. Each key is represented by one bit.
For the bit assignments refer to the following:
KEY_F1 33554432
KEY_F2 67108864
KEY_F3 134217728
KEY_F4 268435456
KEY_F5 536870912
KEY_F6 131072
KEY_F7 262144
KEY_F8 524288
KEY_F9 1048576
KEY_F10 2097152
KEY_F11 1
KEY_F12 2
KEY_F13 4

0.4.3 Comandi / Parametri per i leds

NomeDRACondizioniDescrizione
ledsL0R-W-Leds status
Parametro utilizzato per accendere i LED dei tasti funzione.
Ogni bit del parametro è associato un LED.
Per il valore associato al parametro keyf.
blinkledsL0R-W-Blink Leds status
Parametro utilizzato per far lampeggiare i LED dei tasti funzione.
Ogni bit del parametro è associato un LED.
Per il valore associato al parametro keyf.
N.B. Perché un led possa lampeggiare è necessario associare il valore relativo a quel led sia al parametro leds che al parametro blinkleds.

0.4.4 Comandi / Parametri generici

NomeDRACondizioniDescrizione
languageBRR-W-Language
Parametro per impostare la lingua da visualizzare. I valori vanno da 0 al numero di lingue introdotto -1.
ReverseBRR-WNon gestito
nei display
non grafici
Reverse
Parametro per impostare la modalità reverse del display.
Range 0÷1
contrastWRR-W-Contrast
Parametro per impostare il contrasto del display. Range 1÷99.
Default=33
Per valori prossimi a 99 il display appare scuro, mentre per valori prossimi a 1 appare chiaro.
clrtimeWRR-W-Clear time
Parametro per impostare il tempo associato del tasto CLEAR.
Durante l'inserimento di un dato, se il tasto CLEAR viene premuto per più di quel tempo, il dato introdotto viene azzerato.
errorB0R-Error
Indica se vi sono errori nel device. In dettaglio:
0 = no error
1 = no application present
2 = checksum no match
3 = file format no match
4 = incorrect display size
5 = out of memory
6 = error readin the page
7 = error in erase operation
8 = internal error
9 = error in write memory
10 = error in read operation
11 = internal error
12 = image present but not possible
13 = font not supported
14 = internal error
memuseB0R-Memory used
Indica la percentuale di memoria utilizzata per memorizzare il file applicativo di QPAint.

0.5 Limitazioni

Nessuna limitazione.

0.6 Esempio applicativo

; Accensione di un LED alla pressione del tasto funzione
; (si accende solo il LED F1 e tutti gli altri si spengono).
 
IF   DEV:keyf EQ KEY_F1
     DEV:leds = KEY_F1
ELSE
     DEV:keyf EQ KEY_F1
ENDIF
 
; Accensione di due LED alla pressione di due tasti funzione
; (viene acceso/spento solo il LED relativo al tasto premuto).
 
IF   DEV:keyf EQ KEY_F1
     DEV:leds = DEV:leds ORB KEY_F1
ELSE
     DEV:leds = DEV:leds ANDB (-1-KEY_F1)
ENDIF
 
IF   DEV:keyf EQ KEY_F2
     DEV:leds = DEV:leds ORB KEY_F2
ELSE
     DEV:leds = DEV:leds ANDB (-1-KEY_F2)
ENDIF